package com.hd.crdao.wrapper;

import com.google.gson.Gson;
import com.hd.crdao.bean.MessageBean;
import com.zhy.http.okhttp.callback.Callback;

import java.io.IOException;

import okhttp3.Response;

/**
 *
 *@author Programming
 *@date 2017/7/26 0026
 */
public abstract class BooleanCallback extends Callback<Boolean> {
    //非UI线程，支持任何耗时操作

    public Boolean parseNetworkResponse(Response response) throws IOException {
        String string = response.body().string();
        MessageBean messageBean = new Gson().fromJson(string, MessageBean.class);
            return messageBean.getSuccess() == 0;
    }

}

